package com.mvc.framework.i18n;

import java.text.MessageFormat;
import java.util.Locale;

import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.context.support.AbstractMessageSource;

import com.mvc.framework.util.MessageUtils;


public class DatabaseMessageSource extends AbstractMessageSource implements BeanClassLoaderAware {

	public void setBeanClassLoader(ClassLoader arg0) {
	    
    }

	@Override
    protected MessageFormat resolveCode(String message, Locale locale) {
		message = MessageUtils.getMessage(message, locale);
		return new MessageFormat(MessageUtils.getMessage(message, locale) == null ? "" : message, locale);
    }
	
}
